﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace Shool
{
    public partial class Admin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void ButtonDeleteUser_Click(object sender, EventArgs e)
        {            
            if (Membership.GetUser().UserName != DropDownUsers.Text)
            {                
                Membership.DeleteUser(DropDownUsers.Text, true);
                ButtonShowUsers_Click(this, EventArgs.Empty);
            }
        }

        protected void ButtonShowUsers_Click(object sender, EventArgs e)
        {
            DropDownUsers.DataSource = Membership.GetAllUsers();
            DropDownUsers.DataBind();
            ButtonDeleteUser.Enabled = true;
        }
    }
}